package Exception;

import java.io.File;

public class ExceptionDemo {
    public static void main(String[] args) {
        exception e = new exception();
        try{
            e.f();
        }
        catch (MyException m){
            System.out.println(m.fillInStackTrace());
            System.out.println("222222222222-------------------------------------");
            m.printStackTrace(System.out);
            System.out.println("33333333333333-------------------------------------");
            System.out.println(m.getLocalizedMessage());
        }

}

}
class exception {
    exception() {

    }

    void f() throws MyException {
        System.out.println("111111111----------");
        throw new MyException();
    }
    void g() throws MyException {
        System.out.println("111111111----------");
        throw new MyException();
    }
}
class MyException extends Exception {
    MyException() {
        super("错误~~");
    }
}
